package user.Service;

import common.model.Consultation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import user.repository.ConsultationRepository;

import java.util.List;
@Service
public class ConsultationService {

    @Autowired
    private ConsultationRepository consultationRepository;

    public void consultLawyer(Consultation consultation) {
        consultationRepository.save(consultation);
    }

    public List<Consultation> getUserConsultations(Long userId) {
        return consultationRepository.findByUserId(userId);
    }
}